#include <iostream>

int n;

int main()
{
	std::cin >> n;
	if (n & 1) std::cout << "0\n";
	else {
		long long x = (n / 2) - 1, d;
		d = (x + 1) / 2;
		std::cout << x - d;
	}
}

